package com.java.demo.model;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-07-22
 * Time: 9:25
 */
@Component
public class Students {
    @Bean("student1")
   public Student student1(){
       Student student1=new Student();
       student1.setName("zhangsan");
       return student1;
   }
   @Bean("student2")
    public Student student2(){
        Student student2=new Student();
        student2.setName("wangwu");
        return student2;
   }
}
